package com.huashi.dealer.modular.business.balance.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@Schema(description = "充值审核列表VO")
public class RechargeReviewListVo {
    @Schema(description = "记录ID")
    private Long rechargeReviewId;
    @Schema(description = "用户ID")
    private Long userId;
    @Schema(description = "用户昵称")
    private String nickName;
    @Schema(description = "变更账户 0基本 1返利 2核销")
    private Integer source;
    @Schema(description = "变更类型 inc/dec/final")
    private String mode;
    @Schema(description = "金额")
    private BigDecimal price;
    @Schema(description = "备注")
    private String remark;
    @Schema(description = "初审状态 0待 10通过 20驳回")
    private Integer initialReviewStatus;
    @Schema(description = "初审人ID")
    private Long initialReviewId;
    @Schema(description = "初审人名称")
    private String initialReviewName;
    @Schema(description = "初审时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime initialReviewTime;
    @Schema(description = "初审驳回原因")
    private String initialReviewRejectReason;
    @Schema(description = "复核状态 0待 10通过 20驳回")
    private Integer checkStatus;
    @Schema(description = "复核人ID")
    private Long checkId;
    @Schema(description = "复核人名称")
    private String checkName;
    @Schema(description = "复核时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime checkTime;
    @Schema(description = "复核驳回原因")
    private String checkRejectReason;
    @Schema(description = "申请时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime applyTime;

    /**
     * 获取初审状态文本描述
     *
     * @return 初审状态描述文本
     */
    public String getInitialReviewStatusText() {
        if (this.initialReviewStatus == null) {
            return "未知状态";
        }

        switch (this.initialReviewStatus) {
            case 0:
                return "待审核";
            case 10:
                return "通过";
            case 20:
                return "驳回";
            default:
                return "未知状态";
        }
    }
    /**
     * 根据checkStatus自动计算复核状态文本
     *
     * @return 复核状态描述文本
     */
    @Schema(description = "复核状态文本")
    public String getCheckStatusText() {
        if (this.checkStatus == null) {
            return "未知状态";
        }

        switch (this.checkStatus) {
            case 0:
                return "待审核";
            case 10:
                return "审核通过";
            case 20:
                return "审核驳回";
            default:
                return "未知状态";
        }
    }
}


